<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改简历')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-resume-edit" th:object="${jobResume}">
            <input name="resumeId" th:field="*{resumeId}" type="hidden">
            <input name="userId" th:field="*{userId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">简历名称：</label>
                <div class="col-sm-8">
                    <input name="resumeName" th:field="*{resumeName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">职位类别：</label>
                <div class="col-sm-8">
                    <select name="positionType" class="form-control m-b" th:with="type=${@dict.getType('job_position_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{positionType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">简历内容：</label>
                <div class="col-sm-8">
                    <textarea name="content" class="form-control" required>[[*{content}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">地区：</label>
                <div class="col-sm-8">
                    <select name="area" class="form-control m-b" th:with="type=${@dict.getType('job_area')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">薪资范围：</label>
                <div class="col-sm-8">
                    <select name="salary" class="form-control m-b" th:with="type=${@dict.getType('job_salary')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salary}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生日：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="birthday" th:value="${#dates.format(jobResume.birthday, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">电话：</label>
                <div class="col-sm-8">
                    <input name="phone" th:field="*{phone}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">工作经历：</label>
                <div class="col-sm-8">
                    <textarea name="workExperience" class="form-control">[[*{workExperience}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "job/resume";
        $("#form-resume-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-resume-edit').serialize());
            }
        }

        $("input[name='birthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>